import { edpService } from "./decorators";
import express from 'express';

@edpService
class Service {
  static app: express.Express;
  static serviceName = 'ts-calc'
  static desc = 'a calculator in typescript'
  static category = null
  static tasks = [
      'list_add_1: List<Int>->List<Int>',
      '#instant int_mul_2: Int->Int'
  ]
  list_add_1(inputs: object) {
    const list = inputs as number[];
    return list.map(x => x + 1);
  }
  int_mul_2(inputs: number) {
    return inputs * 2
  }
}
const port = 3001;
Service.app.listen(port, () => {
  console.log(`Server is running on port ${port}.`);
});